<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>交易中心</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel= "stylesheet"  href="../../css/mui.picker.all.css"/>
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/quotation.css" />
		<script type="text/javascript" src="../../js/common.config.js" ></script> 
		<script type="text/javascript" src="../../js/jquery-1.11.3.js" ></script>
		<script src="../../js/esl.js"></script>
		<script src="../../js/mui.min.js"></script>
		 <script src="../../js/common.js"></script>
		<style>
			.mui-bar-nav{
				border-bottom: 1px solid #121212;
			}
			#popover{
				min-width: 282px;
				height: 190px ;
				top:50% !important;
				margin-top: -120px;
				left: 50% !important;
				margin-left: -141px;
			}
			#popover .mui-input-row label~input, .mui-input-row label~select, .mui-input-row label~textarea{
				background-color: #FFFFFF;
			}
			#popoverLoss,#popoverLoss1{
				min-width: 96%;
				height: 200px ;
				top:50% !important;
				margin-top: -100px;
				left: 2% !important;
				background-color: #2b2b2b;
			}
			@media (min-width: 400px){
				#popover{
					width: 80%;
					margin-left: -40%;
				}
			}
			#popoverConditoion{
				min-width: 90%;
				height: 240px ;
				top:50% !important;
				margin-top: -120px;
				left: 5% !important;
				background-color: #2b2b2b;
			}
			.mui-input-row label{
				width: 45%;
				padding:11px 0px 11px 15px;
				height: 40px;
				font-size: 14px;;
			}
			.mui-input-row label~input, .mui-input-row label~select, .mui-input-row label~textarea{
				width: 55%;
				height: 40px;
				font-size: 14px;
				background-color: #2b2b2b;
			}
			#add,#clsoeAdd{
				width: 45%;
				margin-top: 10px;
				display: inline-block;
				border: none;
				height: 40px;
				padding: 0px;
				line-height: 40px;
			}
			#add{
				background-color: #fcc900;
				color:#2b2b2b;
				margin-left: 10px;
				margin-right: 5px;
			}
			#clsoeAdd{
				background-color: #cccccc;
				color:#2b2b2b;
			}
			#topPopover{
				position: fixed;
				z-index: 999;
				top: 16px;
				right: 6px;
				height: 45px;
				/*height: 150px;*/
				width: 35%;
				overflow: hidden;
			}
			#topPopover.mui-popover{
				background-color: #383838;
				border-radius: 15px;
			}
			#topPopover.mui-popover .mui-popover-arrow:after{
				background-color: #383838;
			}
			#topPopover.mui-popover .mui-table-view{
				background-color: #383838;
				color:#999999;
				font-size: 14px;
			}
			#topPopover .mui-table-view-cell:after{
				background-color: #454545;
			}
			.mui-backdrop{
				background-color: rgba(0, 0, 0, .7);
			}
			h5.mui-content-padded {
				margin-left: 3px;
				margin-top: 20px !important;
			}
			h5.mui-content-padded:first-child {
				margin-top: 12px !important;
			}
			h1 {
				position: absolute;
			}
			#toNoviceGuide {
				position: relative;
				left: 14px;
			}
			/*.mui-btn {
				font-size: 16px;
				padding: 8px;
				margin: 3px;
			}*/
			.ui-alert {
				text-align: center;
				padding: 20px 10px;
				font-size: 16px;
			}
			* {
				-webkit-touch-callout: none;
				-webkit-user-select: none;
			}
		</style>
	</head>
	<body style="background-color: #2B2B2B">
		<div id="netWorkTips">当前行情网络未连接，会自动连接！</div>
		<div id="bg1" style="display: block;">
			<header class="mui-bar mui-bar-nav"> 
			    <a class="mui-icon mui-icon-left-nav mui-pull-left quotationBack mui-action-back" id= "backClose"><i>返回</i></a>
			    <h1 class="mui-title mainTitle"><p class="mainTitleFirst"></p><p id="CommodityNo"></p></h1>
			    <span class="mui-icon mui-icon-help" style="color: white;margin-left: 50%;" id="toNoviceGuide"></span>
			     <a class="mui-icon mui-icon-loop mui-pull-right" id="refresh" style="margin-right: 35px;"></a>
			   	<a id="muneBox" href="#topPopover"></a>
			</header>
			<div class="mui-content" style="padding-top: 80px;">
					<div id="headerMenu">
						<table cellpadding="0" cellspacing="0">
							<thead>
								<tr>
									<td id="HandicapButton">盘口</td>
									<td id="lightDiagram">闪电图</td>
									<td  id="timeChartMenu" value="0" class="mui-active">分时</td>
									<td id="selectButon">K线</td>
									<td id="tradeMenu" >交易中心</td>	
								</tr>
							</thead>
						</table>
					</div>
					<div id="headerContent">
						<div id="chartAllDiv" class="bottomDivList mui-active" >
							<div class="chartDivContent mui-active" id="TimeChart1">
								<div id="timeChart" style="width:100%;"></div>
								<div id="volumeChart" style="width:100%;"></div>
							</div>
							<div class="chartDivContent" id="CandlestickChart" style="opacity: 0;">
								<div   id="CandlestickChartDiv" style="width:100%;"></div>
								<div id="CandlestickVolumeChart" style="width:100%;"></div>
							</div>
							<div id="lightChartDiv" class="chartDivContent ">
								<div id="lightChart"></div>
							</div>
							<div class="buttomFix" style="position: fixed;bottom: 0px;height:211px ;">
								<div class="buttomFixLeft mui-col-xs-6">
									<p>卖<span id="buyPrices" class="PricesLeft">-</span ><span id="buyPricesNumber" class="PricesRight">-</span></p>
									<p>买<span id="sellPrices" class="PricesLeft">-</span ><span id="sellPricesNumber" class="PricesRight">-</span></p>
									<p>成交量<span id="volumePricesNumber" class="PricesRight">-</span></p>
								</div>
								<div class="buttomFixRight mui-col-xs-6">
									<p id="freshPrices">0.00</p> 
									<p id="domnRange"><span id="rose">-</span><span id="changeValue">-</span></p>
								</div> 
								<div style="display: none;">
									<input type="text"  id = "exchangeNo"/> 
									<input type="text"  id = "commodeityNo"/>
									<input type="text"  id = "contractNo"/>
									<input type="text"  id = "contractSize" />
									<input type="text"  id= "miniTikeSize"/>
									<input type="text"  id = "doSize"/>
									<input type="text" id="CommodityName" />
									持仓盈亏:<input type="text" value = "0.00" id = "floatingProfit">
								</div>
							</div>
						</div>
						<div id="Handicap" class="bottomDivList" style="margin-top: 10px;">
							<table cellpadding="0" cellspacing="0" id="table_Content">
								<tr>
									<td colspan="2" style="text-align: center;" class="borderRight">盘口</td>
									<td colspan="3" style="text-align: center;" >五档行情</td>
									
								</tr>
								<tr>
									<td >最新</td>
									<td id = "pklastparice" class="borderRight"></td>
									<td>卖五</td>
									<td id = "sell_8">0</td>
									<td id = "sell_9" >0</td>
								</tr>
								<tr>
									<td>开盘 </td>
									<td id = "pkopenprice" class="borderRight">0</td>
									<td>卖四</td>
									<td id = "sell_6">0</td>
									<td id = "sell_7" >0</td>
								</tr>
								<tr>
									<td>最高 </td>
									<td id = "pkhightprice" class="borderRight">0</td>
									<td>卖三</td>
									<td id = "sell_4">0</td>
									<td id = "sell_5" >0</td>
									
								</tr>
								<tr>
									<td>最低 </td>
									<td id  = "pklowprice"class="borderRight">0</td>
									<td>卖二</td>
									<td id = "sell_2">0</td>
									<td id = "sell_3" >0</td>
								</tr>
								<tr>
									<td >涨跌</td>
									<td id = "pkzd" class="borderRight">0</td>
									<!--<td>结算 </td>
									<td id = "pkjs" class="borderRight">0</td>-->
									<td>卖一</td>
									<td id = "sell_0">0</td> 
									<td id = "sell_1" >0</td>
								</tr>
								<tr>
									<td>成交量 </td>
									<td id = "pktrademl" class="borderRight">0</td>
									<td>买一</td>
									<td id = "buy_0">0</td>
									<td id = "buy_1" >0</td>
								</tr>
								<tr>
									<td>持仓量  </td>
									<td id = "pkccml" class="borderRight">0</td>
									<td>买二</td>
									<td id = "buy_2">0</td>
									<td id = "buy_3" >0</td>
								</tr>
								<tr>
									<td>昨结  </td>
									<td id = "pkzj" class="borderRight">0</td>
									<td>买三</td>
									<td id = "buy_4">0</td>
									<td id = "buy_5" >0</td>
								</tr>
								<tr>
									<td></td>
									<td class="borderRight"></td>
									<td>买四</td>
									<td id = "buy_6">0</td>
									<td id = "buy_7" >0</td>
								</tr>
								<tr>
									<td></td>
									<td class="borderRight" ></td>
									<td>买五</td>
									<td id = "buy_8">0</td>
									<td id = "buy_9" >0</td>
								</tr>
							</table>
						</div>
						<div  id="trade" style="padding-bottom: 20px;padding-top: 46px;" class=" bottomDivList">
						    <div class="Assets" style="background-color: #2B2B2B;">
						        <!--<p class="YellowFont">
						        	<span id = "todayBalance">0.00</span>
						        	<span id = "deposit" style="display: none;">0.00</span>
						        	<span id = "todayCanUse" >0.00</span>
						        	<span>亏损平仓线</span>
						        	<span id = "loss-Open-line"></span>
						        </p>
						        <p>
						        	<span>总资产(USD)</span>
						        	<span style="display: none;">保证金(USD)</span>
						        	<span>余额(USD)</span>
						        	<span>强平风险度</span>
						        	<span id="open-risk-degree">123</span>
						        </p>-->
						        <ul class="fl">
						        	<li class="YellowFont">
						        		<span id = "todayBalance">0.00</span>
						        	</li>
						        	<li>
						        		<span>总资产(USD)</span>
						        	</li>
						        </ul>
						        <ul class="fl">
						        	<li class="YellowFont">
						        		<span id = "todayCanUse" >0.00</span>
						        	</li>
						        	<li>
						        		<span>余额(USD)</span>
						        	</li>
						        </ul>
						        <ul class="fl">
						        	<li class="YellowFont">
						        		平仓线: <span id = "loss-Open-line"></span>
						        	</li>
						        	<li>
						        		风险度: <span id="open-risk-degree">0.00%</span>
						        	</li>
						        </ul>
						        <ul style="display: none;" class="fl">
						        	<li style="display: none;">
						        		<span id = "deposit">0.00</span>
						        	</li>
						        	<li style="display: none;">
						        		<span>保证金(USD)</span>
						        	</li>
						        </ul>
						    </div>
						    <div class="ProductInformation">
						        <div class="ProductInformationLeft">
						                <select class="mui-btn mui-btn-block" id = "tradeTitle" >
						                </select>
						                <span id="MainContract"></span>
						            <span class="mui-icon mui-icon-search" id="searchIcon"></span>
						        </div>
						        <div class="ProductInformationRight">
						            <p class="whiteFont">新：<span id = "lastPrice">0.00</span><span class="dataRight" id= "totalVolume">0.00</span></p>
						            <p class="whiteFont">卖：<span id = "sellLastPrice">0.00</span><span class="dataRight" id = "askQty">0.00</span></p>
						            <p class="whiteFont">买：<span id = "buyLastPrice">0.00</span><span class="dataRight" id = "bidQty">0.00</span></p>
						        </div>
						    </div>
						    <form id="buyFuture">
						        <div class="butomBoreder">
						        	<table  cellpadding="0" cellspacing="0" id="radioDiv">
						        		<tr>
						        			<td>
						                		<span><input type="radio" id="sj" checked name="prices" value="1" class="radioChoice"></span>
						                		<label>市价</label>
						        			</td>
						        			<td >
						                		<span><input type="radio"  id="xj" class="radioChoice" value="0" name="prices"></span>
						                		<label>限价</label>
						        			</td>
						        		</tr>
						        		<tr>
						        			<td>
						        				<label class="labelTitle">手数:</label>
						        				<input id = "orderNumber"  onkeypress="if((event.keyCode<48 || event.keyCode>57)) event.returnValue=false" class = "numberResize"  value="1" placeholder="输入手数" type="tel">
						        			</td>
						        			<td>
						        				<label class="labelTitle">价格:</label>
						        				<input  id = "orderPrice" onkeypress="if(event.keyCode!=46 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"  disabled="disabled" class = "numberResize"  type="number" placeholder = "市价">
						        			</td>
	
						        		</tr>
						        	</table>
						        </div>
						        <div class="buyBtn">
						            <button type="button" class="mui-btn mui-col-xs-6 buy " id = "buy" data-tion-buy = "0" ><p id="switchBuy">买入</p><p id = "buyBtn_P" class = "buyBtnPrices">市价</p></button>
						            <button type="button" class="mui-btn mui-col-xs-6 buy " id = "sell" data-tion-buy = "1"><p id="switchSell" >卖出</p><p id = "sellBtn_P" class = "buyBtnPrices">市价</p></button>
						        </div>
						    </form>
						    <div id="segmentedControl" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-primary" style="border-bottom: 1px solid #121212;">
						        <a class="mui-control-item mui-active" href="#item1" id = "holdCC">持仓</a>
						        <a class="mui-control-item" href="#item2" id = "desgnateGD">挂单</a>
						        <a class="mui-control-item" href="#item3" id = "tradeWT">委托</a>
						        <a class="mui-control-item" href="#item4" id = "successCJ">成交</a>
						    </div>
						    <div>
						        <div id="item1" class="mui-control-content mui-active" >
						            <ul id="positionList" class="listStyle" style="height: 165px; width: 100%;" >
						                <li class="PositionLi" ><a class="mui-navigate-right"><span>合约名称</span><span>多空</span><span>手数</span><span>持仓均价</span><span class="dateTimeFloat">浮动盈亏</span></a></li>
						            </ul>
						            <button type="button" class="mui-btn mui-col-xs-5 focusButton" id="allOpen">全部平仓</button>
						            <button type="button" class="mui-btn mui-col-xs-5 focusButton" id="Open">平仓</button>
						            <button type="button" class="mui-btn mui-col-xs-5 focusButton" id="stopLoss" >止损止盈</button>
						        </div>
						        <div id="item2" class="mui-control-content">
						            <ul  id="postersOrder" class="listStyle" style="height: 165px; width: 100%;" >
						                <li class="fisrtLi Guadan"><a class="mui-navigate-right"><span>合约名称</span><span>买卖</span><span>委托价</span><span>委托量</span><span>挂单量</span><span class="dateTimeL">挂单时间</span></a></li>
						            </ul>
						             <button type="button" class="mui-btn focusButton" id="fullWithdrawal">全撤</button>
						            <button type="button" class="mui-btn focusButton " id="kilAnorder">撤单</button>
						           <button type="button" class="mui-btn focusButton" id="changeSingle">改单</button>
						        </div>
						        <div id="item3" class="mui-control-content" style="width: 100%;">
						            <ul  id="Entrust" class="listStyle" style="height: 165px;" >
						                <li class="fisrtLi EntrustOreder"><a class="mui-navigate-right" ><span>合约名称</span><span>状态</span><span>买卖</span><span>委托价</span><span>委托量</span><span>已成交</span><span>已撤单</span><span class="dateTimeL">下单时间</span></a></li>
						            </ul>
						        </div> 
						        <div id="item4" class="mui-control-content" >
						            <ul  id="Deal" class="listStyle" style="height: 165px;">
						                <li class="DealLi" ><a class="mui-navigate-right" ><span>合约名称</span><span>买卖</span><span>成交价</span><span>成交量</span><span class="dateTimeL">成交时间</span></a></li>
						            </ul>
						        </div>
						    </div>
						</div>
					</div>
					
					<div id="list_type" >
						<span id="sanjiao"></span>
						<ul >
							<li value="1">1分</li>
							<li value="5">5分</li>
							<li value="15">15分</li>
							<li value="30">30分</li>
							<li value="1440">日K</li>
						</ul>
					</div>
				</div>
				<div class="BuyDiv">
					<div id="numberInput">
						<label>手数:</label>
						<input onkeypress="if((event.keyCode<48 || event.keyCode>57)) event.returnValue=false"  value="1" id = "orderNum" type="tel" placeholder="输入手数">
						<label>（价格：市价）</label>
					</div>
					<div class="buttonDivList">
						<button type="button" class="mui-btn marketBuy " id="marketBuy" data-tion-buy = "0">买入</button>
						<button type="button" class="mui-btn  marketBuy" id="marketSell" data-tion-buy = "1">卖出</button>
					</div>
				</div>
				<div id="popover" class="mui-popover">
					<div class="mui-content-padded">
					<h4 id="title" style="text-align: center;margin-top: 10px;">改单</h4>
						<form class="mui-input-group" style="margin-top: 10px;">
							<div class="mui-input-row">
								<label>委托价格：</label>
								<input type="text" class="mui-input-clear" id="col1" placeholder="请输入" onblur="value=value.replace(/[^\d\.]/g,'')">
							</div>
							<div class="mui-input-row">
								<label>委托数量：</label>
								<input type="text" class="mui-input-clear" id="col2" placeholder="请输入" onblur="value=value.replace(/[^\d\.]/g,'')">
							</div>
						</form>
						<div id="add_div" class="operate mui-hidden">
							<button type="button" class="mui-btn mui-btn-blue" id="add">确定</button>
							<button type="button" class="mui-btn mui-btn-blue" id="clsoeAdd">取消</button>
						</div>
					</div>
				</div>
				<!---------------------------------下拉菜单--------------------------->
				<div id="topPopover" class="mui-popover">
					<div class="mui-popover-arrow"></div>
					<div>
						<div>
							<ul class="mui-table-view">
								<li class="mui-table-view-cell">
									<a id="switchAccount">切换账号</a>
								</li>
								<li class="mui-table-view-cell" id="openConditionButton">
									<a id="openCondition">条件单</a>
								</li>
								<li class="mui-table-view-cell" id="openStopButton">
									<a id="openStop">止损单</a>
								</li>
								<li class="mui-table-view-cell" id="historyDeal">
									<a id="historytable">历史成交</a>
								</li>
							</ul>
						</div>
					</div>
				</div>
<!---------------------------------止损单右侧弹窗--------------------------->
				<div id="popoverLoss" class="mui-popover">
				    <div id="segmentedControlStopLoss" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-primary" style="border-bottom: 1px solid #121212;">
				        <a class="mui-control-item mui-active" href="#stopTitle" >止损</a>
				        <a class="mui-control-item" href="#lossTitle" >止盈</a>
				    </div>
				    <div>
				    	<div id="stopTitle" class="mui-control-content mui-active">
				    		<table>
				    			<tr>
				    				<td class="oddTd" id = "stopOddTd">合约</td>
				    				<td class="evenTd" id = "stopEvenTd">富时A50</td>
				    				<td class="oddTd borderLeft" id = "stopBorderLeft">多头</td>
				    				<td class="evenTd">最新：<i class="evenPrice" id = "stopEvenPrice"></i></td>
				    			</tr>
				    			<tr>
				    				<td class="oddTd">方式</td>
				    				<td  colspan="3">
				    					<select class="mui-btn mui-btn-block selectComm" id="choiceStopPrices">
				    						<option value="0">止损价</option>
				    						<option value="2">动态价</option>
				    					</select>
				    					<input type="hidden" id = "stopHoldAvgPrice" />
				    					<input type="number" value="0" id="stopChoicePrices1" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
				    					<span id="Increase">0.00%</span>
				    				</td>
				    			</tr>
				    			<tr>
				    				<td class="oddTd">手数</td>
				    				<td class="evenTd "><input type="number" value="1" id="stopNumber" class="stopCommStyle" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')"></td>
				    				<td class="oddTd borderLeft" colspan="2" style="border-right: none;">止损委托价：			
				    					<span>市价</span>
				    				</td>
				    			</tr>
				    			<tr>
				    				<td colspan="2" id="closeStopTable">关闭</td>
				    				<td colspan="2" id="insertStopData" style="border-right: none;">添加</td>
				    			</tr>
				    		</table>
				    	</div>
				    	<div id="lossTitle" class="mui-control-content">
				    		<table>
				    			<tr>
				    				<td class="oddTd">合约</td>
				    				<td class="evenTd " id = "lossContractCode">富时A50</td>
				    				<td class="oddTd borderLeft" id = "lossDrection">多头</td>
				    				<td class="evenTd">最新：<i class="evenPrice" id = "lossEventPrice"></i></td>
				    			</tr>
				    			<tr>
				    				<td class="oddTd">止盈价</td>
				    				<td  colspan="3">
				    					<input type="hidden" id = "lossHoldAvgPrice" />
				    					<input type="number" value="0" style = "width: 40%;" id="lossChoicePrices2" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
				    					<span id="lossIncrease1">0.00%</span>
				    				</td> 
				    			</tr>
				    			<tr>
				    				<td class="oddTd">手数</td>
				    				<td class="evenTd "><input type="number" value="1" id="lossNumber" class="stopCommStyle" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')"></td>
				    				<td class="oddTd borderLeft" colspan="2" style="border-right: none;">止盈委托价：			    					
				    					<!--<select class="mui-btn mui-btn-block selectComm" >-->
				    						<span value = "1">市价</span>
				    						<!--<option value = "2">对手价</option>-->
				    					<!--</select>-->
				    				</td>
				    			</tr>
				    			<tr>
				    				<td colspan="2" id="closeLossTable">关闭</td>
				    				<td colspan="2" id="insertLossData" style="border-right: none;">添加</td>
				    			</tr>
				    		</table>
				    	</div>
				    </div>
				</div>
			</div> 
			<!---------------------------------条件单--------------------------->
			<div id="bg2" style="display: none;">
				<header class="mui-bar mui-bar-nav">
		   		    <a class="mui-icon mui-icon-left-nav mui-pull-left quotationBack " id= "stopBack"><i>返回</i></a>
				    <h1 class="mui-title" style="color: #CCCCCC;">条件单</h1>
				    <a class="mui-pull-right" id="insertCondition" class = "insertCondition"></a>
				</header>
				<div class="mui-content" style="padding: 0px;position: absolute;top: 46px;z-index: 997;width: 100%;">
					<div id="segmentedControlCondition" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-primary" style="border-bottom: 1px solid #121212;position: fixed;z-index: 998;">
				        <a class="mui-control-item mui-active" href="#NoCondition" id="NoConditionTitle">未触发列表</a>
				        <a class="mui-control-item" href="#alreayCondition" id="alreayConditionTitle">已触发列表</a>
				    </div>
				    <div class="mui-control-content mui-active" id="NoCondition">
				    	<table  id="conditionTable">
				    		<thead>
				    			<tr>
				    				<td>合约名称</td>
				    				<td>状态</td>
				    				<td>类型</td>
				    				<td>条件</td>
				    				<td>下单</td>
				    				<td>有效日期</td>
				    				<td>下单时间</td>
				    			</tr>
				    		</thead>
							<tbody id = "thodyCondition" >

							</tbody>
				    	</table>
				   	 </div>
				    <div class="mui-control-content" id="alreayCondition">
				    	<table>
				    		<thead>
				    			<tr>
				    				<td>合约名称</td>
				    				<td>状态</td>
				    				<td>类型</td>
				    				<td>条件</td>
				    				<td>下单</td>
				    				<td>有效日期</td>
				    				<td>触发时间</td>
				    			</tr>
				    		</thead>
				    		<tbody id = "over-thbodyCondition">
				    		</tbody>
				    	</table>
				    </div>
				    	<button value="2"  class = "updateCondition" id="suspendCondition">暂停</button>
						<button value="0" id="modifyCondition">修改</button>
						<button value="1" class = "updateCondition" id="deleteCondition">删除</button>
						<div id="stopTips1" class="stopTips">
							<div>提示</div>
							<div>
								<p>1.云端止损单只保证触发不保证成交</p>
								<p>2.暂不支持显示套利止损单</p>
							</div>
						</div>
				</div>
<!-----------------------------添加条件单的弹窗---------------------------->				
				<div id="popoverConditoion" class="mui-popover">
				    <div id="segmentedControlConditoion" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-primary" style="border-bottom: 1px solid #121212;">
				        <a class="mui-control-item mui-active" id = "plan_conditionTitlePrice" href="#ConditoionTitlePrices" >价格条件</a>
				        <a class="mui-control-item" id = "plan_conditionTitleTime" href="#ConditoionTitleTime" >时间条件</a>
				    </div>
				    <div>
				    	<div id="ConditoionTitlePrices" class="mui-control-content mui-active">
				    		<table>
								<tr>
				    				<td >合约</td>
				    				<td >
				    					<select class="mui-btn mui-btn-block selectComm" id="chioceContract">
				    					</select> 
				    				</td>
				    				<td>最新</td>
				    				<!--显示条件单--条件价格-->
				    				<td><span id="showConditionPrice"></span></td>
				    			</tr>
				    			<tr>
				    				<td >方式</td>
				    				<td class="borderRight">
				    					<select class="mui-btn mui-btn-block selectComm" id="chiocePrices">
				    						<option value = "0">></option>
				    						<option value = "2">>=</option>
				    						<option value = "1"><</option>
				    						<option value = "3"><=</option>
				    					</select>
				    					<input type="number" value="0"  id="ConditoionPricesInput" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')"/>
				    				</td>
				    				<td colspan="2">
				    					<select class="mui-btn mui-btn-block selectComm" id="chioceAdditional">
				    						<option value = "-1">附加</option>
				    						<option value = "0">></option>
				    						<option value = "2">>=</option>
				    						<option value = "1"><</option>
				    						<option value = "3"><=</option>
				    					</select>
				    					<input type="number " value="0"  id="ConditoionPricesInput1" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" />
				    				</td>
				    			</tr>
				    			<tr>
				    				<td >操作</td>
				    				<td class="borderRight">
				    					<select class="mui-btn mui-btn-block selectComm" id="shopDrection">
				    						<option value = "0">买</option>
				    						<option value = "1">卖</option>
				    					</select>
				    					<select class="mui-btn mui-btn-block selectComm" id="chiocePricesSelect">
				    						<option value = "1">市价</option>
				    						<option value = "2">对手价</option>
				    					</select>
				    				</td>
				    				<td class="borderRight">手数</td>
				    				<td ><input type="number" value="0"  id="ConditoionPricesInput3" onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" /></td>
				    			</tr>
				    			<tr> 
				    				<td>有效</td>
				    				<td colspan="3">当日有效</td>
				    			</tr>
				    		</table>
							<button id="closeConditionTable">取消</button>
							<button id="insertConditionTable">添加</button>
				    	</div>
				    	<div id="ConditoionTitleTime" class="mui-control-content">
				    		<table>
								<tr>
				    				<td >合约</td>
				    				<td >
				    					<select class="mui-btn mui-btn-block selectComm" id="chioceContract1">
				    					</select>
				    				</td>
				    				<td>最新</td>
				    				<!--显示条件单——时间条件价格-->
				    				<td><span id="showConditionPrice1"></span></td>
				    			</tr>
				    			<tr>
				    				<td >时间</td>
				    				<td>
				    					<input type="text" placeholder="选择时间" data-options='{"type":"time"}' id="insertTimeInput"   readonly="readonly"/>
				    				</td>
				    				<td></td>
				    				<td></td>
				    			</tr>
				    			<tr >
				    				<td>价格</td>
				    				<td>
				    					<select class="mui-btn mui-btn-block selectComm" id="chioceTimeAdditional">
				    						<option value = "-1">附加</option>
				    						<option value = "0">></option>
				    						<option value = "2">>=</option>
				    						<option value = "1"><</option>
				    						<option value = "3"><=</option>
				    					</select>
				    					<input type="number " value="0"  id="ConditoionTimePricesInput" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" />
				    				</td>
				    				<td></td>
				    				<td></td>
				    			</tr>
				    			<tr>
				    				<td >操作</td>
				    				<td class="borderRight">
				    					<select class="mui-btn mui-btn-block selectComm" id="shopDrectionTime">
				    						<option value = "0">买</option>
				    						<option value = "1">卖</option>
				    					</select>
				    					<select class="mui-btn mui-btn-block selectComm" id="chiocePricesSelectTime">
				    						<option value = "1">市价</option>
				    						<option value = "2">对手价</option>
				    					</select>
				    				</td>
				    				<td class="borderRight">手数</td>
				    				<td ><input type="number " value="0"  id="ConditoionTimeInput" onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" /></td>
				    			</tr>
				    			<tr> 
				    				<td>有效</td>
				    				<td colspan="3">当日有效</td>
				    			</tr>
				    		</table>
							<button id="closeConditionTable1">取消</button>
							<button id="insertConditionTable1">添加</button>
				    	</div>
				    </div>
				</div>
			</div> 
<!--------------------------止损单---------------------------------->
			<div id="bg3" style="display: none;">
				<header class="mui-bar mui-bar-nav" style="position: fixed;z-index: 998;">
		   		    <a class="mui-icon mui-icon-left-nav mui-pull-left quotationBack" id= "conditionBack"><i>返回</i></a>
				    <h1 class="mui-title" style="color: #CCCCCC;">止损单</h1>
				</header>
				<div class="mui-coontent" style="position: absolute;z-index: 997;top: 46px;width: 100%;">
					<div id="segmentedControlStop" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-primary" style="border-bottom: 1px solid #121212;position: fixed;z-index: 998;">
				        <a class="mui-control-item mui-active" href="#NoStopTale" id="NoStopListTitle">未触发列表</a>
				        <a class="mui-control-item" href="#alreayStopTale" id="alreayStopListTitle">已触发列表</a>
				    </div>
				    <div class="mui-control-content mui-active" id="NoStopTale">
				    	<table class="ConditionList" id="clickTable">
				    		<thead>
				    			<tr>
				    				<td>合约名称</td>
				    				<td>状态</td>
				    				<td>多空</td>
				    				<td>类别</td>
				    				<td>手数</td>
				    				<td>触发条件</td>
				    				<td>委托价</td>
				    				<td>有效期</td>
				    				<td>下单时间</td>
				    			</tr>
				    		</thead>
				    		<tbody id = "clickTableBody">
				    		</tbody>
							
				    	</table>
				    </div>
				    <div class="mui-control-content" id="alreayStopTale">
				    	<table class="ConditionList">
				    		<thead>
				    			<tr>
				    				<td>合约名称</td>
				    				<td>状态</td>
				    				<td>多空</td>
				    				<td>类别</td>
				    				<td>手数</td>
				    				<td>触发条件</td>
				    				<td>委托价</td>
				    				<td>有效期</td>
				    				<td>触发时间</td>
				    			</tr>
				    		</thead>
				    		<tbody id = "over-clickTableBody">
				    		</tbody>
				    	</table>
				    </div>
				    <button value="2" class = "updateStopLoss" id="suspendCondition1">暂停</button>
					<button value="0" id="modifyCondition1">修改</button>
					<button value="1" class = "updateStopLoss" id="deleteCondition1">删除</button>
					<div id="stopTips" class="stopTips">
						<div>提示</div>
						<div>
							<p>1.云端止损单只保证触发不保证成交</p>
							<p>2.暂不支持显示套利止损单</p>
						</div>
					</div>
				</div>
				<div id="popoverLoss1" class="mui-popover">
				    <div id="segmentedControlStopLoss" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-primary" style="border-bottom: 1px solid #121212;">
				        <a class="mui-control-item mui-active ustopTitle" href="#stopTitle1"  id= "ustopTitle">止损</a>
				        <a class="mui-control-item ulossTitle mui-active" href="#lossTitle1" id= "ulossTitle">止盈</a>
				    </div>
				    <div>
				    	<div id="stopTitle1" class="mui-control-content mui-active  ustopTitle">
				    		<table>
				    			<tr>
				    				<td class="oddTd" id = "stopOddTd1">合约</td>
				    				<td class="evenTd" id = "stopEvenTd1">富时A50</td>
				    				<td class="oddTd borderLeft" id = "stopBorderLeft1">多头</td>
				    				<td class="evenTd">最新：<i class="evenPrice" id = "stopEvenPrice1"></i></td>
				    			</tr>
				    			<tr>
				    				<td class="oddTd">方式</td>
				    				<td  colspan="3">
				    					<select class="mui-btn mui-btn-block selectComm" id="choiceStopPrices2">
				    						<option value="0">止损价</option>
				    						<option value="2">动态价</option>
				    					</select>
				    					<input type="hidden" id = "stopHoldAvgPrice1" />
				    					<input type="number" value="0" id="stopChoicePrices3" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
				    					<span id="Increase2">0.00%</span>
				    				</td>
				    			</tr>
				    			<tr>
				    				<td class="oddTd">手数</td>
				    				<td class="evenTd "><input type="number" value="1" id="stopNumber1" class="stopCommStyle" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')" ></td>
				    				<td class="oddTd borderLeft" colspan="2" style="border-right: none;">止损委托价：
				    					<select class="mui-btn mui-btn-block selectComm" id="choiceStopPrices3">
				    						<option value = "1">市价</option>
				    						<!--<option value = "2">对手价</option>-->
				    					</select>
				    				</td>
				    			</tr>
				    			<tr>
				    				<td colspan="2" id="closeStopTable1">关闭</td>
				    				<td colspan="2" id="insertStopData1" style="border-right: none;">修改</td>
				    			</tr>
				    		</table>
				    	</div>
				    	<div id="lossTitle1" class="mui-control-content mui-active  ulossTitle">
				    		<table>
				    			<tr>
				    				<td class="oddTd">合约</td>
				    				<td class="evenTd " id = "ulossContractCode">富时A50</td>
				    				<td class="oddTd borderLeft" id = "uDrection">多头</td>
				    				<td class="evenTd">最新：<i class="evenPrice" id = "uEvenPrice"></i></td>
				    			</tr>
				    			<tr>
				    				<td class="oddTd">止盈价</td>
				    				<td  colspan="3">
				    					<input type="hidden" id = "ulossHoldAvgPrice1" />
				    					<input type="number" value="0" style="width: 40%;" id="uLossPrice" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
				    					<span id="lossIncrease2">0.00%</span>
				    				</td>
				    			</tr>
				    			<tr>
				    				<td class="oddTd">手数</td>
				    				<td class="evenTd "><input type="number" value="1" id="ulossNumber" class="stopCommStyle" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')"></td>
				    				<td class="oddTd borderLeft" colspan="2" style="border-right: none;">止盈委托价：
				    					<select class="mui-btn mui-btn-block selectComm" id="uchoiceLossPrices">
				    						<span value = "1">市价</span>
				    						<!--<option value = "2">对手价</option>-->
				    					</select>
				    				</td>
				    			</tr>
				    			<tr>
				    				<td colspan="2" id="closeLossTable1">关闭</td>
				    				<td colspan="2" id="uinsertLossData1" style="border-right: none;">修改</td>
				    			</tr>
				    		</table>
				    	</div>
				    </div>
				</div>
			</div>
			<style>
				.calendar {height: 45px; line-height: 40px; color: #ffffff; font-size: 12px; background: #2b2b2b; border-bottom: 5px solid #1f1f1f;}
		    	.calendar > div {float: left; background: #1f1f1f; border-radius: 5px; width: 148px; padding-left: 5px; height: 30px; margin-top: 5px;}
		    	.calendar > div input {margin-bottom: 0; text-align: center; width: 122px; background: #1f1f1f; height: 29px;border: 1px solid #1f1f1f; padding: 0; margin: 0; position: relative; top: -5px; font-size: 12px}
		    	.calendar > div > label img {width: 17px; height: 17px; position: relative; top: -1px;}
		    	.calendar > span {float: right;}
		    	#qryHisTrade {color: #ffffff;  text-align: center;margin-top: 10px; }
		    	#directSeedTitle {background: #2b2b2b; border-bottom: 1px solid #1f1f1f;}
		    	#directSeedTitle a {border: none; color: #cccccc; font-size: 14px;}
		    	#directSeedTitle a.mui-active {color: #ffd400;}
		    	#chartContainerContent ul li {float: left; list-style-type: none;}
		    	#chartContainerContent .ul-lis {background: #383838; height: 40px;margin: 0;padding: 0; color: #999999; font-size: 14px;}
		    	#historyDetailsTables tr td {color: #ffffff; font-size: 14px; height: 40px; line-height: 40px;}
		    	#historyDetailsTables thead tr td {color: #999999; background: #383838;}
		    	#hisTradeList {background: #2b2b2b;}
		    	#hisTradeList tr {border: 1px solid #1f1f1f;}
		    	.quotationBack i {font-style: normal; font-size: 14px; vertical-align: 2px;}
		    	.mui-dtpicker{height: 274px;}
		    	#historyDetailsTables thead tr td:first-child {text-align: center;}
	    		#historyDetailsTables tr td:first-child {text-align: center;}
	    		#historyDetailsTables {width: 850px; overflow-x: scroll;}
	    		#chartContainerContent {padding-top: 85px;}
			</style>
			<!--历史成交-->
			<div id="bg4" style="display: none;">
				<header class="mui-bar mui-bar-nav" style="position: fixed;z-index: 998;">
		   		    <a class="mui-icon mui-icon-left-nav mui-pull-left quotationBack" id= "historyback"><i>返回</i></a>
				    <h1 class="mui-title" style="color: #CCCCCC;">历史成交</h1>
				    <span id="qryHisTrade" class="mui-pull-right">查询</span>
				</header>
				<div class="mui-coontent" style="position: absolute;z-index: 997;top: 46px;width: 100%;">
					<div class="mui-slider-item" id="directSeedNews" style="position: static;">
						<div style="position: fixed; z-index: 9;">
						<div class="calendar">
							<div style="margin-left: 5px;" class="btn1" id='timechioce' data-options='{}'>
								<label class="btn"><img src="../../images/directSeedCalendar.png" alt="" /></label>
								<input type="text" id="finance" readonly="readonly" placeholder="开始时间">
							</div>
							<p style="float: left;">→</p>
							<div id='timechioce1' class="btn2" data-options='{}'>
								<label  class="btn"><img src="../../images/directSeedCalendar.png" alt="" /></label>
								<input type="text" id="finance1" readonly="readonly" placeholder="结束时间">
							</div>
						</div>
						<div class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted" id="directSeedTitle">
							<a class="mui-control-item title_school  mui-active">一天内</a>
							<a class="mui-control-item title_school">一周内</a> 
							<a class="mui-control-item title_school">一月内</a> 
						</div>
						</div>
						<div id="chartContainerContent">
							<div id="chartContainerContent1">
								<div class="mui-scroll" style="padding-bottom: 120px;">
									<div class="table_div" id="table_div">
										<table id="historyDetailsTables">
											<thead>
												<tr>
													<td width="50px">序号</td>
													<td width="100px">合约代码</td>
													<td width="100px">交易所</td>
													<td width="100px">币种</td>
													<td width="50px">买卖</td>
													<td width="150px">成交价</td>
													<td width="50px">成交量</td>
													<td width="100px">手续费</td>
													<td width="150px">成交时间</td>
												</tr>
											</thead>
											<tbody id="hisTradeList">
												<tr class="red">
													<td width="50px">序号</td>
													<td width="100px">合约代码</td>
													<td width="100px">交易所</td>
													<td width="100px">币种</td>
													<td width="50px">买卖</td>
													<td width="150px">成交价</td>
													<td width="50px">成交量</td>
													<td width="100px">手续费</td>
													<td width="150px">成交时间</td>
												</tr>
												<tr class="green">
													<td width="50px">序号</td>
													<td width="100px">合约代码</td>
													<td width="100px">交易所</td>
													<td width="100px">币种</td>
													<td width="50px">买卖</td>
													<td width="150px">成交价</td>
													<td width="50px">成交量</td>
													<td width="100px">手续费</td>
													<td width="150px">成交时间</td>
												</tr>
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>
						<div id="stopTips1" class="stopTips" style="z-index: 999; background: #2b2b2b; bottom: 0; padding: 10px;">
							<div>提示</div>
							<div>
								<p>1.历史成交明细只可查询当日凌晨5点之前的数据；</p>
								<p>2.当日的成交明细可到交易中心-》成交中心查询；</p>
								<p>2.若有问题可拨打：400-852-8008；</p>
							</div>
						</div>
					</div>
				</div>	
			</div>
			
			</div>
			</div>
		</body>
			<script>
				function init(param){
					$("#exchangeNo").val(param[3]);
					$("#commodeityNo").val(param[2]);
					$("#contractNo").val(param[1]);
					$("#contractSize").val(param[5]);
					$("#lastPrice").text(param[7]);
					$("#miniTikeSize").val(param[6]);
					$("#doSize").val(param[4]);
				}
				mui.plusReady(function(){
//					点击到交易规则
					$("#toNoviceGuide").on("tap",function(){
						mui.openWindow({
							url:"../agree/noviceGuide.html",
							id : "noviceGuide" 
						})
					})
				loadCss();
				var Proportion=1;
    			function loadCss(){
		    			var Proportion=1;
						var screen=window.innerHeight;
							$("#timeChart,#CandlestickChartDiv").css({
								"width":"100%",
								"height":screen-300-105+"px",
							});
							$("#volumeChart,#CandlestickVolumeChart").css({
								"width":"100%",
								"height":105+"px",
							});
							$("#lightChart").css({
								"width":"100%",
								"height":screen-300+"px",
							});
							$("#alreayStopTale,#NoStopTale,#alreayCondition,#NoCondition").css({
								"height":screen-160+"px",
							})
						}	
					/*
					 增加新手引导的样式
					 */
			});
			</script>
		<script type="text/javascript" src="../../js/jquery.base64.js" ></script>
		<script type="text/javascript" src="../../js/mui.picker.all.js"></script>
		<script type="text/javascript" src="../../js/util.js" ></script>
		<script type="text/javascript" src="../../js/trade.util.js" ></script>
		<script type="text/javascript" src="../../js/trade.data.mode.js" ></script>
		<script type="text/javascript" src="../../js/trade.config.js" ></script>
		<script type="text/javascript" src="../../js/trade.connection.js" ></script>
		<script type="text/javascript" src="../../js/trade.send.js" ></script>
		<script src="../../js/chart.config.js"></script>
		<script src="../../js/timechart.config.js"></script>
		<script src="../../js/candlestick.config.js"></script>
		<script src="../../js/lightChart.config.js"></script>
		<script src="../../js/chart.js"></script>
		<script type="text/javascript" src="../../js/trade.js" ></script>
		<script type="text/javascript">
			mui.init();
			mui.plusReady(function(){  
				console.log(CacheQuoteBase)
				$(function(){
					$("#refresh").addClass("rotateClass");
				})
				var Transfer=plus.webview.currentWebview();
				var CommodityNo=document.getElementById("CommodityNo");
				var mainTitleFirst=document.getElementsByClassName("mainTitleFirst")[0];
				mainTitleFirst.innerHTML=Transfer.name[0];
				CommodityNo.innerHTML=Transfer.name[2]+Transfer.name[1];
				var candlestickChartItem = document.getElementById('CandlestickChart');
				init(Transfer.name);
				cachTranFers(Transfer.name);
				console.log(Transfer.name);
				var i = 0 ;
				$(window).resize(function() {
					if(i % 2 == 0){  
						$(".focusButton").css("display","none");
					}else{
						$(".focusButton").css("display","block");
						if(localStorage.getItem("isMock")==1){
						}else{
							$("#stopLoss").css("display","none");
						}
					}
					i++; 
				});
				if(localStorage.getItem("isMock")==1){
					$("#marketBuy").text("模拟买入");
					$("#switchBuy").text("模拟买入");
					$("#marketSell ").text("模拟卖出");
					$("#switchSell").text("模拟卖出");
					$("#openStopButton").css("display","block");
					$("#openConditionButton").css("display","block");
					$("#stopLoss").css("display","block");
					$("#Open").css("right","25%");
					$("#allOpen").css("right","50%");
					$("#topPopover").css("height","173px");
				}
				var network = false;
				mui('.mui-scroll-wrapper').scroll();
				document.getElementById("clsoeAdd").addEventListener("tap",function(){
						mui("#popover").popover("toggle");
				});
				document.getElementById("closeLossTable").addEventListener("tap",function(){
					mui("#popoverLoss").popover("toggle");
				});
				document.getElementById("closeStopTable").addEventListener("tap",function(){
					mui("#popoverLoss").popover("toggle");
				})
				document.getElementById("closeLossTable1").addEventListener("tap",function(){
					mui("#popoverLoss1").popover("toggle");
				});
				document.getElementById("closeStopTable1").addEventListener("tap",function(){
					mui("#popoverLoss1").popover("toggle");
				});
				/*document.getElementById("historyDeal").addEventListener("tap",function(){
					mui.openWindow("historyDeal.html");
				});*/
				
				document.getElementById("insertCondition").addEventListener("tap",function(){
					initConditionData(); 
					$("#ConditoionTitlePrices").addClass("mui-active");
					$("#plan_conditionTitlePrice").addClass("mui-active").css("display","table-cell").text("价格条件");
					$("#plan_conditionTitleTime").removeClass("mui-active").css("display","table-cell").text("时间条件");
					$("#ConditoionTitleTime").removeClass("mui-active");
					mui("#popoverConditoion").popover("toggle");
					$("#insertConditionTable1").text("添加");
					$("#insertConditionTable").text("添加");
				});
				document.getElementById("closeConditionTable1").addEventListener("tap",function(){
					mui("#popoverConditoion").popover("toggle");
				});
				document.getElementById("closeConditionTable").addEventListener("tap",function(){
					mui("#popoverConditoion").popover("toggle");
				});
				document.getElementById("stopBack").addEventListener("tap",function(){
					$("#bg2").css("display","none");
					$("#bg3").css("display","none");
					$("#bg1").css("display","block");
					$("#topPopover").css("display","none");
					$(".mui-content").eq(0).css("z-index","998");
				});
				document.getElementById("conditionBack").addEventListener("tap",function(){
					$("#bg2").css("display","none");
					$("#bg3").css("display","none");
					$("#bg1").css("display","block");
					$("#topPopover").css("display","none");
					$(".mui-content").eq(0).css("z-index","998");
				});
				document.getElementById("historyback").addEventListener("tap",function(){
					$("#bg2").css("display","none");
					$("#bg3").css("display","none");
					$("#bg1").css("display","block");
					$("#bg4").css("display","none");
					$("#finance").val("");
					$("#finance1").val("");
					$("#topPopover").css("display","none");
					$(".mui-content").eq(0).css("z-index","998");
				});
				document.getElementById("openStop").addEventListener("tap",function(){
					if(isLogin){
						if(plus.storage.getItem("QuotationGuidanceTrade2")==null){
							plus.storage.setItem("QuotationGuidanceTrade2","1");
								var height=window.innerHeight;
								var width=window.innerWidth;
								$(".top").css({"height":height+"px",
										"width":width+"px",
										"position":"fixed",
										"z-index":"999",
										"display":"block",
										"top":"0px",
										"background":"url('../../images/stopBg.png') no-repeat",
										"background-size":"cover",
										})		
						}
						$("#bg1").css("display","none");
						$("#bg2").css("display","none");
						$("#bg3").css("display","block");
						mui("#topPopover").popover("toggle");
						$(".mui-content").eq(2).css("z-index","998");
					}else{
						mui.openWindow({url:"../login/operateLogin.html",id:"operateLogin.html",extras:{backpageID:"transactionDetails"}});
					}
				});
				document.getElementById("historytable").addEventListener("tap",function(){
					if(isLogin){
						if(plus.storage.getItem("QuotationGuidanceTrade2")==null){
							plus.storage.setItem("QuotationGuidanceTrade2","1");
								var height=window.innerHeight;
								var width=window.innerWidth;
								$(".top").css({"height":height+"px",
										"width":width+"px",
										"position":"fixed",
										"z-index":"999",
										"display":"block",
										"top":"0px",
										"background":"url('../../images/stopBg.png') no-repeat",
										"background-size":"cover",
										})		
						}
						$("#bg1").css("display","none");
						$("#bg2").css("display","none");
						$("#bg3").css("display","none");
						$("#bg4").css("display","block");
						mui("#topPopover").popover("toggle");
						$(".mui-content").eq(2).css("z-index","998");
						$('#hisTradeList').children().remove();
						history_index=1;
						Trade.doQryHisTrade(username,getYesterdayDate(),getCurrentDate());
					}else{
						mui.openWindow({url:"../login/operateLogin.html",id:"operateLogin.html",extras:{backpageID:"transactionDetails"}});
					}
				});
				document.getElementById("openCondition").addEventListener("tap",function(){
					if(isLogin){
						if(plus.storage.getItem("QuotationGuidanceTrade1")==null){
							plus.storage.setItem("QuotationGuidanceTrade1","1");
							var QuotationGuidanceTradeTimeOut=null;
							var height=window.innerHeight;
							var width=window.innerWidth;
							var clickBottomNum=0;
							QuotationGuidanceTradeTimeOut=setTimeout(function(){
								$(".bottom").css({
										"height":height+"px",
										"width":width+"px",
										"position":"fixed",
										"z-index":"999",
										"display":"block",
										"top":"0px",
										"background":"url('../../images/conditionBg.png') no-repeat",
										"background-size":"cover",
									});
									
							},400)
								$(".bottom").click(function(){
									clearTimeout(QuotationGuidanceTradeTimeOut);
									if(clickBottomNum==0){
										$(".bottom").css({
											"background":"url('../../images/conditionBg1.png') no-repeat",
											"background-size":"cover",
										});
									}else{
										$(".bottom").css("display","none")
									}
									clickBottomNum++;
								})
						}
						$("#bg1").css("display","none");
						$("#bg3").css("display","none");
						$("#bg2").css("display","block");
						mui("#topPopover").popover("toggle");
						$(".mui-content").eq(1).css("z-index","998");
					}else{
						mui.openWindow({url:"../login/operateLogin.html",id:"operateLogin.html",extras:{backpageID:"transactionDetails"}});
					}
				});
				$("#clickTable").on("tap",".testclick1",function(){
					$(this).addClass('clickBg');    // 设置被点击元素为黑色
        			$(this).siblings('tr').removeClass('clickBg'); // 去除所有同胞元素的黑色样式
				})
				$("#thodyCondition").on("tap","tr",function(){
					 $(this).addClass('clickBg');    // 设置被点击元素为黑色
        			$(this).siblings('tr').removeClass('clickBg'); // 去除所有同胞元素的黑色样式
				})
				document.getElementById("alreayStopListTitle").addEventListener("tap",function(){
					$("#suspendCondition1,#modifyCondition1,#deleteCondition1,#stopTips").css("display","none");
				})
				document.getElementById("NoStopListTitle").addEventListener("tap",function(){
					$("#suspendCondition1,#modifyCondition1,#deleteCondition1,#stopTips").css("display","block");
				})
				document.getElementById("alreayConditionTitle").addEventListener("tap",function(){
					$("#suspendCondition,#modifyCondition,#deleteCondition,#stopTips1,#insertCondition").css("display","none");
				})
				document.getElementById("NoConditionTitle").addEventListener("tap",function(){
					$("#suspendCondition,#modifyCondition,#deleteCondition,#stopTips1,#insertCondition").css("display","block");
				})
			});
			(function($) {
				$.init();
					document.getElementById("insertTimeInput").addEventListener('tap', function() {
						var optionsJson = this.getAttribute('data-options') || '{}';
						var options = JSON.parse(optionsJson);
						var id = this.getAttribute('id');
						/*
						 * 首次显示时实例化组件
						 * 示例为了简洁，将 options 放在了按钮的 dom 上
						 * 也可以直接通过代码声明 optinos 用于实例化 DtPicker
						 */
						var picker = new $.DtPicker(options);
						picker.show(function(rs) {
							/*
							 * rs.value 拼合后的 value
							 * rs.text 拼合后的 text
							 * rs.y 年，可以通过 rs.y.vaue 和 rs.y.text 获取值和文本
							 * rs.m 月，用法同年
							 * rs.d 日，用法同年
							 * rs.h 时，用法同年
							 * rs.i 分（minutes 的第二个字母），用法同年
							 */
							console.log(rs.text);
							document.getElementById("insertTimeInput").value = rs.text;
							/* 
							 * 返回 false 可以阻止选择框的关闭
							 * return false;
							 */
							/*
							 * 释放组件资源，释放后将将不能再操作组件
							 * 通常情况下，不需要示放组件，new DtPicker(options) 后，可以一直使用。
							 * 当前示例，因为内容较多，如不进行资原释放，在某些设备上会较慢。
							 * 所以每次用完便立即调用 dispose 进行释放，下次用时再创建新实例。
							 */
							picker.dispose();
						});
					}, false);
			})(mui);
			
			
			
		</script>
		<script>
		
			 tranferParam = null ;
			/**
			 * 获取行情请求的数据-并初始化页面 
			 */
			function setTimeOutInsertOrder(){
				tradeSetTimeOut = setTimeout(function(){
								plus.nativeUI.closeWaiting(); 
							},10000);
			}
			function cachTranFers(param){ 
				tranferParam = param;
			}
			var loginOutFlag = false;
			var loginOutTip=false;
			$(function(){ 
				$("#orderPrice").bind("input",function(){
					var orderPrice = $(this).val(); 
					if(orderPrice == undefined || orderPrice.length == 0){
						orderPrice = 0;
					}
					$("#buyBtn_P").text(orderPrice);
					$("#sellBtn_P").text(orderPrice);
				});
				$('#password').bind('input propertychange', function() {
				  	var orderPrice = $("#orderPrice").val();
				  	$("#buyBtn_P").val(orderPrice);
				  	$("#sellBtn_P").val(orderPrice);
				});
				$("input[type='radio']").click(function(){
					var type = $("input[type = 'radio']:checked").val();
					$("#buyFuture table td span").css("background","url('../../images/inputRadioBg.png') no-repeat")
					if(type==1){
						$("#buyFuture table td:nth-child(1) span").css({"background":"url('../../images/inputRadioBgC.png') no-repeat","background-size":"100% auto"});
						$("#buyFuture table td:nth-child(2) span").css({"background":"url('../../images/inputRadioBg.png') no-repeat","background-size":"100% auto"});
					}else{
						$("#buyFuture table td:nth-child(2) span").css({"background":"url('../../images/inputRadioBgC.png') no-repeat","background-size":"100% auto"});
						$("#buyFuture table td:nth-child(1) span").css({"background":"url('../../images/inputRadioBg.png') no-repeat","background-size":"100% auto"});
					}
					var orderPrice = $("#orderPrice");
					var lastPrice = $("#lastPrice").text();
					var miniTikeSize = $("#miniTikeSize").val();
					var doSize = $("#doSize").val();
					if(type == 1){  
						$("#buyBtn_P").text("市价");
						$("#sellBtn_P").text("市价");
						orderPrice.prop("placeholder","市价");
						orderPrice.prop("value",""); 
						orderPrice.prop("disabled",true);
					}else{
						orderPrice.prop("disabled",false);
						orderPrice.prop("value",lastPrice); 
						$("#buyBtn_P").text(lastPrice);
						$("#sellBtn_P").text(lastPrice);
						orderPrice.prop("placeholder","");
					}
				});
				if(username == null){
					$("#switchAccount").text("登录账号");
				}
			});
			//监听安卓返回键
			mui.plusReady(function(){
				plus.key.addEventListener("backbutton",function(){
//					var p=plus.webview.getWebviewById("transactionDetails");
//					if(p){
//						mui.app_refresh('quotationMain');  
//					}
					mui.app_refresh('quotationMain'); 
//					mui.openWindow({url:"quotationMain.html",id:"quotationMain"});
				});
			});
	</script>
	<script type="text/javascript">
		/*年月日-日历*/
		(function($) {
			$.init();
			var result = $('#finance')[0];
			var btns = $('.btn1');
			btns.each(function(i, btn) {
				btn.addEventListener('tap', function() {
					var optionsJson = this.getAttribute('data-options') || '{}';
					var options = JSON.parse(optionsJson);
					var id = this.getAttribute('id');
					var picker = new $.DtPicker(options);
					picker.show(function(rs) {
						result.value = rs.y.text+'-'+ rs.m.text + '-'+ rs.d.text + ' '+ rs.h.text + ':'+ rs.i.text + ':'+ "00";
						picker.dispose();
					});
				}, false);
			});
			var result1 = $('#finance1')[0];
			var btns1 = $('.btn2');
			btns1.each(function(i, btn) {
				btn.addEventListener('tap', function() {
					var optionsJson = this.getAttribute('data-options') || '{}';
					var options = JSON.parse(optionsJson);
					var id = this.getAttribute('id');
					var picker = new $.DtPicker(options);
					picker.show(function(rs) {
						result1.value = rs.y.text+'-'+ rs.m.text + '-'+ rs.d.text + ' '+ rs.h.text + ':'+ rs.i.text + ':'+ "00";
						picker.dispose();
					});
				}, false);
			});
		})(mui);
	</script>
	<script type="text/javascript">
		$("#qryHisTrade").on("tap",function(){
			var finance = $("#finance").val();
			var finance1 = $("#finance1").val();
			if(!finance){
				mui.toast('请输入开始时间');
				return;
			}
			if(!finance1){
				mui.toast('请输入结束时间');
				return;
			}
			/*console.log(finance);
			finance = finance.replace(/-/g,'/');  
			var time = new Date(finance).getTime(); 
			time =parseInt(time/1000+21*24*3600); 
			finance1 = finance1.replace(/-/g,'/');  
			var time1 = new Date(finance1).getTime(); 
			time1 =parseInt(time1/1000+21*24*3600); 
			if(time1 <= time) {
				mui.toast('请输入结束时间大于开始时间');
				return;
			}*/
			$('#hisTradeList').children().remove();
			history_index=1;
			Trade.doQryHisTrade(username,finance,finance1);
		});
	</script>	
</html>
